package svc

import (
	"book/service/shorturl/cmd/api/internal/config"
	"book/service/shorturl/cmd/rpc/shorturlclient"

	"github.com/tal-tech/go-zero/zrpc"
)

type ServiceContext struct {
	Config      config.Config
	ShorturlRpc shorturlclient.Shorturl
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:      c,
		ShorturlRpc: shorturlclient.NewShorturl(zrpc.MustNewClient(c.ShorturlRpc)),
	}
}
